<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<!DOCTYPE html>
<html lang="en">
	<head>
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
		<meta charset="utf-8" />

		<meta name="description" content="overview &amp; stats" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />

		<!-- bootstrap & fontawesome -->
		<link rel="stylesheet" href="plug-in/ace2/assets/css/bootstrap.min.css" />
		<link rel="stylesheet" href="plug-in/ace2/assets/css/font-awesome.min.css" />
	 

		<!-- page specific plugin styles -->

		<!-- text fonts -->
		<link rel="stylesheet" href="plug-in/ace2/assets/css/ace-fonts.css" />

		<!-- ace styles -->
		<link rel="stylesheet" href="plug-in/ace2/assets/css/ace.min.css" id="main-ace-style" />

		<!--[if lte IE 9]>
			<link rel="stylesheet" href="../assets/css/ace-part2.min.css" />
		<![endif]-->
		<link rel="stylesheet" href="plug-in/ace2/assets/css/ace-skins.min.css" />
		<link rel="stylesheet" href="plug-in/ace2/assets/css/ace-rtl.min.css" />

		<!--[if lte IE 9]>
		  <link rel="stylesheet" href="../assets/css/ace-ie.min.css" />
		<![endif]-->

		<!-- inline styles related to this page -->

		<!-- ace settings handler -->
		<script src="plug-in/ace2/assets/js/ace-extra.min.js"></script>
	

		<!-- HTML5shiv and Respond.js for IE8 to support HTML5 elements and media queries -->

		<!--[if lte IE 8]>
		<script src="../assets/js/html5shiv.min.js"></script>
		<script src="../assets/js/respond.min.js"></script>
		<![endif]-->
		<link href="plug-in/lhgDialog/skins/metrole.css" rel="stylesheet" id="lhgdialoglink">
		
		<link rel="stylesheet" href="css/userCenter/userCenter.css"/>
		<t:base type="jquery,easyui,tools"></t:base>
		
		
		<style type="text/css">
		tr,.itemDevice{
		cursor:pointer;
		}
		.price{
		float:right;
		color:#FF892A;
		}
		.inline{
		width:100%;
		}
		#main-container{
			padding-top:10px;			
		}
		</style>
	</head>

	<script>
		
	
		
		
		function changeHeadPhoto(){
			 var addurl = 'userCenterController.do?changeHeadPhoto';
			  $.dialog({
				  	id:'xxx',
					content: 'url:'+addurl,
					lock : true,
					zIndex: 1000, 
					width:550,
					height:350,
					title:'修改头像', 
					opacity : 0.3,
					cache:false,
				    ok: function(){
				    	iframe = this.iframe.contentWindow;
				    	$('#btn_sub', iframe.document).click(); 
				    	location.reload();
						return false;
				    },
				    cancelVal: '关闭',
				    cancel: true /*为true等价于function(){}*/
				});
		}
		
		function editUserInfo(){
			 var addurl = 'userCenterController.do?editUserInfo';
			  $.dialog({
				  	id:'xxx',
					content: 'url:'+addurl,
					lock : true,
					zIndex: 1000, 
					width:450,
					height:230,
					title:'编辑资料', 
					opacity : 0.3,
					cache:false,
				    ok: function(){
				    	iframe = this.iframe.contentWindow;
				    	$('#btn_sub', iframe.document).click(); 
						return false;
				    },
				    cancelVal: '关闭',
				    cancel: true /*为true等价于function(){}*/,
				    close: function(){
				    	location.reload();
				    }
				});
		}
	</script>

	<body class="no-skin">	 

		<div class="main-container" id="main-container">
				<table class="userInfo">
				<tr>
					<td rowspan="4" style="padding-left:20px;">
						<img class="userPhoto" alt="" src="cms-attach.do?get&attachId=${user.attachId }">
						<div id="button-group">
							<button id="selectPhotoBtn" onclick="changeHeadPhoto()">选择头像</button>
						</div>
					</td>
					<td>
						<table style="border-spacing: 19px;     border-left: 1px solid #eee;  border-collapse: separate;">
							<tr>
								<td colspan="6" style="text-align: right;"><button onclick="editUserInfo()">编辑资料</button></td>
							</tr>
							<tr>
								<td style="width:60px;">工号：</td>
								<td>${user.staffNo }</td>
								<td>姓名：</td>
								<td>${user.name }</td>
								<td>联系方式：</td>
								<td>
								<c:set var="string1" value="${user.phone}"/>
								<c:set var="string2" value="${fn:substring(string1, 0, 3)}" />
								<c:set var="string3" value="${fn:substring(string1, 7, 11)}" />
								${string2}****${string3}
								</td>
							</tr>
							<tr>
								<td>性别：</td>
								<td>
								<c:if test="${user.sex ==0}">男</c:if>
								<c:if test="${user.sex ==1}">女</c:if>
								</td>
								<td>出生年月：</td>
								<td><fmt:formatDate value="${user.birth }" pattern="yyyy-MM-dd"/></td>
								<td>学院：</td>
								<td>${userCollegeName}</td>
							</tr>
							<tr>
								<td>专业：</td>
								<td>${user.major }</td>
							</tr>
						</table>
					</td>
					<td style="width:30%;cursor: default;">
						  <blockquote class="text-warning" style="font-size:14px">
						  	<h4 class="text-danger" style="padding-bottom:5px;">系统提示</h4>
						  	尊敬的用户，为了保证您顺利的使用系统，建议按如下操作：
						  	<div style="line-height:25px;font-size:14px;">
							  	1)为使获得更好的系统体验建议使用谷歌浏览器，<a style='color:#428bca' href="http://sw.bos.baidu.com/sw-search-sp/software/89c331de74e21/ChromeStandalone_61.0.3163.100_Setup.exe">点击下载</a>；<br>
								2)为使获得更好的系统体验建议您安装最新的flash插件，
								<a style='color:#428bca' href='https://get2.adobe.com/cn/flashplayer/'>点此下载Flash</a>。
							</div>				            
      				  </blockquote>
					</td>
				</tr>
			</table>		
			
			<div class="main-content">				
				<div class="page-content">
					<div class="page-content-area">
			
						<div class="row">
							<div class="col-xs-12">
								<div class="hr hr32 hr-dotted"></div>

								<div class="row">
									<div class="col-sm-5" style="margin-left:20px;min-height:200px;">
										<div class="widget-box transparent">
											<div class="widget-header widget-header-flat">
												<h4 class="widget-title lighter"> 
													<i class="ace-icon fa fa-envelope orange"></i>
													最新消息
												</h4>

												<div class="widget-toolbar">
													<a href="jformInnerMailController.do?indexMoreList">更多	</a>
												</div>
											</div>

											<div class="widget-body">
												<div class="widget-main no-padding">
													<table class="table table-bordered table-striped">
														<thead class="thin-border-bottom">
															<tr>
																<th>标题</th>
																<th>时间</th>
																<th class="hidden-480">类型</th>
															</tr>
														</thead>

														<tbody id="message" >
														</tbody>
													</table>
												</div>
											</div>
										</div>
									</div>
									<div class="col-sm-5" style="margin-left:20px;min-height:200px;">
										<div class="widget-box transparent">
											<div class="widget-header widget-header-flat">
												<h4 class="widget-title lighter"> 
													<i class="ace-icon fa fa-time orange"></i>
													待审核提醒
												</h4>
												<div class="widget-toolbar">
													<a href="jformInnerMailController.do?indexMoreAuditList">更多	</a>
												</div>
											</div>

											<div class="widget-body">
												<div class="widget-main no-padding">
													<table class="table table-bordered table-striped">
														<thead class="thin-border-bottom">
															<tr>
																<th>标题</th>
																<th>时间</th>
															</tr>
														</thead>
														<tbody id="auditMsg" >
														</tbody>
													</table>
												</div>
											</div>
										</div>
									</div>
									
								<!-- PAGE CONTENT ENDS -->
							</div><!-- /.col -->
							
							</div><!-- /.row -->
							<div class="col-xs-12">
								<div class="hr hr32 hr-dotted"></div>

								<div class="row">
									<div class="col-sm-5" style="margin-left:20px;min-height:200px;">
										<div class="widget-box transparent">
											<div class="widget-header widget-header-flat">
												<h4 class="widget-title lighter"> 
													<i class="ace-icon fa fa-envelope orange"></i>
													我的实验
												</h4>

												<div class="widget-toolbar">
													<a href="computerRoomController.do?indexMoreList">更多	</a>
												</div>
											</div>

											<div class="widget-body">
												<div class="widget-main no-padding">
													<table class="table table-bordered table-striped">
														<thead class="thin-border-bottom">
															<tr>
																<th>实验室及机床</th>
																<th>开始时间</th>
																<th class="hidden-480">结束时间</th>
															</tr>
														</thead>
														<tbody id="myExp" >
														</tbody>
													</table>
												</div><!-- /.widget-main -->
											</div><!-- /.widget-body -->
										</div><!-- /.widget-box -->
									</div><!-- /.col -->
									<div class="col-sm-5" style="margin-left:20px;min-height:200px;">
										<div class="widget-box transparent">
											<div class="widget-header widget-header-flat">
												<h4 class="widget-title lighter"> 
													<i class="ace-icon fa fa-envelope orange"></i>
													我的课表
												</h4>

												<div class="widget-toolbar">
													<a href="stuTimeTableController.do?indexMoreList">更多	</a>
												</div>
											</div>

											<div class="widget-body">
												<div class="widget-main no-padding">
													<table class="table table-bordered table-striped">
														<thead class="thin-border-bottom">
															<tr>
																<th>课程</th>
																<th>实验室</th>
																<th>时间</th>
																<th>节次</th>
															</tr>
														</thead>
														<tbody id="myCourse" >
														</tbody>
													</table>
												</div><!-- /.widget-main -->
											</div><!-- /.widget-body -->
										</div><!-- /.widget-box -->
									</div><!-- /.col -->
									
								<!-- PAGE CONTENT ENDS -->
							</div><!-- /.col -->
							
							</div><!-- /.row -->
							
					</div><!-- /.page-content-area -->
				</div><!-- /.page-content -->
			</div><!-- /.main-content -->

		</div><!-- /.main-container -->
		


			<a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse">
				<i class="ace-icon fa fa-angle-double-up icon-only bigger-110"></i>
			</a>
			</div>

		<!-- basic scripts -->

		<!--[if !IE]> -->
		<script type="text/javascript">
			window.jQuery || document.write("<script src='plug-in/ace2/assets/js/jquery.min.js'>"+"<"+"/script>");
		</script>

		<!-- <![endif]-->


		<script src='plug-in/ace2/assets/js/jquery.min.js'></script>
		<script src="plug-in/ace2/assets/js/bootstrap.min.js"></script>

		<!-- page specific plugin scripts -->

		<!--[if lte IE 8]>
		  <script src="../assets/js/excanvas.min.js"></script>
		<![endif]-->
		<script src="plug-in/ace2/assets/js/jquery-ui.custom.min.js"></script>
		<script src="plug-in/ace2/assets/js/jquery.ui.touch-punch.min.js"></script>
		<script src="plug-in/ace2/assets/js/jquery.easypiechart.min.js"></script>
		<script src="plug-in/ace2/assets/js/jquery.sparkline.min.js"></script>
		<script src="plug-in/ace2/assets/js/flot/jquery.flot.min.js"></script>
		<script src="plug-in/ace2/assets/js/flot/jquery.flot.pie.min.js"></script>
		<script src="plug-in/ace2/assets/js/flot/jquery.flot.resize.min.js"></script>

		<!-- ace scripts -->
		<script src="plug-in/ace2/assets/js/ace-elements.min.js"></script>
		<script src="plug-in/ace2/assets/js/ace.min.js"></script>

		  
		
		
		<script src="plug-in/ace2/docs/assets/js/language/javascript.js"></script>
		<script type="text/javascript" src="plug-in/lhgDialog/lhgdialog.min.js?skin=metrole"></script>
		<script type="text/javascript">
		$(document).ready(function(){			
			initAuditMessage();
			initMessage();
			initUseRoom();			
			initOpenLab();
			initMyCourse();
			
		});
		
		
		function initMyCourse(){
				  var url = "stuTimeTableController.do?getMyCourseOnIndex";
					$.ajax({
			    		url:url,
			    		type:"GET",
			    		dataType:"JSON",
			    		data:{
			    		},
			    		success:function(data){
			    			$("#myCourse").html("");
			    			for(var i=0;i<data.length;i++){
			    				var tr = "<tr> <td>"+data[i].lesson+"</td><td>"
			    				+data[i].lab+"</td><td>"
			    				+data[i].date+"</td><td>"
			    				+data[i].order+"</td></tr> "; 
			    				$("#myCourse").append(tr);
			    			}
			    			if(data.length == 0){
			    				$("#myCourse").append("<tr ><td colspan='2'>暂无本周课程信息！</td></tr>");
			    			}
			    		}
		    	});
		}
		 
		  
	 
		  
		 
		  //初始化待审核信息
		  function initAuditMessage(){
			  var url = "jformInnerMailController.do?indexAuditList";
			  $.ajax({
		    		url:url,
		    		type:"GET",
		    		dataType:"JSON",
		    		data:{
		    		},
		    		success:function(data){	
		    			$("#auditMsg").html(""); 
		    			for(var i=0;i<data.length;i++){
		    				var tr = "<tr><td>"+data[i].title+"</td><td><b class=\"green\">"+data[i].sendTime+"</b></td><td class=\"hidden-480\">";
	    					tr = tr+"<span class=\"label label-info arrowed-right arrowed-in\">提醒</span>	</td></tr>";
		    				$("#auditMsg").append(tr);
		    			}
		    		}
		    	});
		  }
		  
		
		  
		  function initMessage(){
			  var url = "jformInnerMailController.do?indexMessageList";
				$.ajax({
		    		url:url,
		    		type:"GET",
		    		dataType:"JSON",
		    		data:{
		    		},
		    		success:function(data){	
		    			$("#message").html(""); 
		    			for(var i=0;i<data.length;i++){
		    				var tr = "<tr onclick=\"doReadMessage('"+data[i].id+"','"+data[i].mailId+"')\"><td>"+data[i].title+"</td><td><b class=\"green\">"+data[i].sendTime+"</b></td><td class=\"hidden-480\">";
		    				if(data[i].type == "0"){
		    					tr = tr+"<span class=\"label label-info arrowed-right arrowed-in\">提醒</span>	</td></tr>";
		    				}else{
		    					tr = tr+"<span <span class=\"label label-danger arrowed\">警告</span>	</td></tr>";
		    				}
		    				$("#message").append(tr);
		    			}
		    		}
		    	});
	  }
		  
	
	/*
	*	初始化我预约的实验，我的实验
	*/
	function initUseRoom(){
			  var url = "computerRoomController.do?indexList";
				$.ajax({
		    		url:url,
		    		type:"GET",
		    		dataType:"JSON",
		    		data:{
		    		},
		    		success:function(data){	
		    			$("#myExp").html(""); 
		    			for(var i=0;i<data.length;i++){
		    				var tr="<tr><td>"
		    				+ data[i].name
		    				+"</td><td>"
		    				+ data[i].start
		    				+"</td><td>"
		    				+ data[i].end+"</td></tr>";
		    				$("#myExp").append(tr);
		    			}
		    			if(data.length == 0){
		    				$("#myExp").append("<li>暂无信息！</li>");
		    			}
		    		}
		    	});
	  }
	 
		  
		  
		  function doRead(id,isRead){
			  if(isRead!=1){
				  var url = "systemNoticeController.do?updateNoticeRead";
					$.ajax({
			    		url:url,
			    		type:"GET",
			    		dataType:"JSON",
			    		data:{
			    			noticeId:id
			    		},
			    		success:function(data){
// 			    			if(data.success){
// 			    				$('#noticeList').datagrid({   
// 			    				    rowStyler:function(index,row){   
// 			    				        if (row.isRead!=1){
// 			    				            return 'font-weight:bold !important;';   
// 			    				        }else{
// 			    				        	return 'font-weight:normal;';
// 			    				        }
// 			    				    }   
// 			    				});
// 			    			}
			    		}
			    	});
			  }
			  var addurl = "systemNoticeController.do?goNotice&id="+id;
			  $.dialog({
				  	id:'xxx',
					content: 'url:'+addurl,
					lock : true,
					zIndex: 1000, 
					width:680,
					height:600,
					title:'公告详情 ', 
					opacity : 0.3,
					cache:false,
				    cancelVal: '关闭',
				    cancel: true /*为true等价于function(){}*/
				});
		  }
		
		  function doReadMessage(id,mailid){
			  var addurl = "jformInnerMailController.do?goDetail&id="+id+"&mailid="+mailid;
			  $.dialog({
				  	id:'xxx',
					content: 'url:'+addurl,
					lock : true,
					zIndex: 1000, 
					width:580,
					height:400,
					title:'站内信详情 ', 
					opacity : 0.3,
					cache:false,
				    cancelVal: '关闭',
				    cancel: true /*为true等价于function(){}*/
				});
		  }
		  
		</script>
	</body>
</html>
